import time

import pygame, sys


class GmTool:
    @staticmethod
    def quit():
        """退出游戏"""
        pygame.quit()
        sys.exit(0)

    @staticmethod
    def load_music(filename):
        pygame.mixer.music.load(filename)

    @staticmethod
    def play_music():
        pygame.mixer.music.play(-1)

    @staticmethod
    def pause_music():
        pygame.mixer.music.pause()

    @staticmethod
    def resume_music():
        pygame.mixer.music.unpause()

    @staticmethod
    def stop_music():
        pygame.mixer.music.stop()

    @staticmethod
    def save_screenshot(self):
        filename = time.strftime('screenshots/%Y%m%d%H%M%S.png')
        pygame.image.save(self.screen, filename)
